﻿@using System.Data;
@using System.Web;
@using DTcms.Web.MVC.Areas.Web.Controllers;
@using DTcms.Web.MVC.UI.Controllers;
@using DTcms.Model;
@{
   Layout = "~/Areas/Web/Views/" + ViewBag.TemplateSkin + "/web/Shared/_LayoutShow.cshtml";
   DTcms.Model.channel_site site = ViewData["site"] as DTcms.Model.channel_site;
   DTcms.Model.siteconfig config = ViewData["config"] as DTcms.Model.siteconfig;
   DTcms.Model.article m = ViewData["model"] as DTcms.Model.article;
   Article_ShowController bc = ViewBag.BasePage as Article_ShowController;
   string category_title = bc.get_category_title(m.category_id, "视频专区");
   ViewBag.Title = m.title + " - " + category_title + " - " + site.name;
   string channel = "video";
   DataTable list = null;
   int count = 0;
}
@section HeaderContent{
   <script src="~/Scripts/ckplayer/ckplayer.js"></script>
}
@section Scripts{
<script>
$(function(){
	//设置视频容器大小
	winResize();
	$(window).resize(function() {
		winResize();
	});
	//初始化视频容器
	initCKPlayer('video-box', '@m.fields["video_src"]', '@(config.webpath)scripts/ckplayer/ckplayer.swf');
});
//改变大小函数
function winResize(){
	if($(".section").width() == 1180){
		$(".video-box").width(840);
		$(".video-box").height(473);
	}else{
		$(".video-box").width(601);
		$(".video-box").height(338);
	}
}
</script>
}

<div class="section clearfix">
  <!--右边-->
  <div class="list-right">
    <div class="sidebar-box">
      <div class="line30"></div>
      <h3>视频类别</h3>
      <ul class="navbar">
        @{ 
        list = bc.get_category_child_list(channel, 0);
        foreach(DataRow dr in list.Rows){
        <li>
          <h4><a href="@bc.linkurl("video_list",dr["id"])">@dr["title"]</a></h4>
          <p>
            @{ 
               DataTable list2 = bc.get_category_child_list(channel, Convert.ToInt32(dr["id"]));
               foreach(DataRow cdr2 in list2.Rows){
                  if(Convert.ToInt32(cdr2["id"]) == m.category_id){
                     <a href="@bc.linkurl("video_list",cdr2["id"])" class="selected">@cdr2["title"]</a>
                  }else{
                     <a href="@bc.linkurl("video_list",cdr2["id"])">@cdr2["title"]</a>
                  }
               }
             }
          </p>
        </li>
        }
        }
      </ul>
      <div class="line20"></div>
      <h3>推荐视频</h3>
      <div class="focus-list">
        <ul>
          @{ 
          list = bc.get_article_list(channel, 0, 4, "status=0 and is_red=1");
          foreach(DataRow dr in list.Rows){
          <li>
            <a title="@dr["title"]" href="@bc.linkurl("video_show",dr["id"])">
              <b>
                <em></em>
                <img src="@dr["img_url"]" />
              </b>
              <span>@dr["title"]</span>
            </a>
          </li>
          }
          }
        </ul>
      </div>
      <div class="line10"></div>
      <h3>人气排行</h3>
      <ul class="rank-list">
        @{ 
        list = bc.get_article_list(channel, 0, 10, "status=0", "click desc,id desc");
        foreach(DataRow dr in list.Rows){
           count ++;
           if(count == 1){
             <li class="active">
             <span>@DateTime.Parse(dr["add_time"].ToString()).ToString("MM-dd")</span>
             <i class="num">@count</i><a href="@bc.linkurl("video_show",dr["id"])">@dr["title"]</a>
             </li>
           }else{
             <li>
             <span>@DateTime.Parse(dr["add_time"].ToString()).ToString("MM-dd"))</span>
             <i class="num">@count</i><a href="@bc.linkurl("video_show",dr["id"])">@dr["title"]</a>
             </li>               
           }
        }
        }
      </ul>
      
    </div>
  </div>
  <!--/右边-->
  
  <!--左边-->
  <div class="list-auto">
    <div class="line30"></div>
    <div id="video-box" class="video-box"></div>

    <div class="meta">
      <h1>@m.title</h1>
      <p class="meta-info">
        <span class="time">@m.add_time</span>
        <span class="comm"><script type="text/javascript" src="@(config.webpath)tools/submit_ajax.ashx?action=view_comment_count&id=@m.id}"></script>人评论</span>
        <span class="view"><script type="text/javascript" src="@(config.webpath)tools/submit_ajax.ashx?action=view_article_click&id=@m.id}&click=1"></script>次浏览</span>
        分类：@category_title
      </p>
    </div>
    
    <div class="entry">
      @Html.Raw(m.content)
    </div>
    
    <!--上下篇-->
    <div class="next-prev-single">
      <p class="prev">上一篇：@Html.Raw(bc.get_prevandnext_article("video_show", -1, "没有了", 0))</p>
	  <p class="next">下一篇：@Html.Raw(bc.get_prevandnext_article("video_show", 1, "没有了", 0))</p>
    </div>
    <!--/上下篇-->
    
    <div class="line15"></div>
    <!--相关推荐-->
    <h2 class="base-tit">
      <span>相关图片</span>
    </h2>
    <div class="rel-list">
      <ul>
        @{ 
        list = bc.get_article_list(channel, m.category_id, 4, "is_red=1 and id<>" + m.id);
        foreach(DataRow dr in list.Rows){
        <li>
          <div class="img-box">
            <a title="@dr["title"]" href="@bc.linkurl("video_show",dr["id"])">
              <img src="@dr["img_url"]" />
            </a>
          </div>
          <div class="info">
            <h3><a title="@dr["title"]" href="@bc.linkurl("video_show",dr["id"])">@dr["title"]</a></h3>
            <p>@dr["zhaiyao"]</p>
            <span>@dr["add_time"]</span>
          </div>
        </li>
        }
        if(list.Rows.Count<1){
         <div class="nodata">暂无相关的视频...</div>
        }
        }
      </ul>
    </div>
    <!--/相关推荐-->
    <div class="clear"></div>
    
    <!--用户评论-->
    @if(m.is_msg==1){
    <h2 class="base-tit">
      <i>共有<b><script type="text/javascript" src="@(config.webpath)tools/submit_ajax.ashx?action=view_comment_count&id=@m.id}"></script></b>访客发表了评论</i>
      <span>网友评论</span>
    </h2>
    @RenderPage("~/Areas/Web/Views/" + ViewBag.TemplateSkin + "/web/Shared/partial_comment_box.cshtml")
    }
    <!--用户评论-->
    
  </div>
  <!--/左边-->
  
</div>